package de.sendorian.app.forumArchive.repository;

import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.stereotype.Component;

import de.sendorian.app.forumArchive.domain.User;


@Component
public class UserRepository extends RepositoryBase<User> {

	public UserRepository() {
		super(User.class);
	}


	public User findByName(String name) {
		try {
			return findByUniqueAttribute("name", name);
		} catch (EmptyResultDataAccessException e) {
			logger.debug("No User found with name " + name);
		}
		return null;
	}
}
